<template>
  <div>
    <finder ref="finderDlg" @treesel="onSel"></finder>
    <a-tree-select
      v-model="value"
      show-search
      style="width: 30%"
      :dropdown-style="{ overflow: 'auto' }"
      placeholder="请选择"
      allow-clear
      :tree-data="treeData"
      @select="onSel"
      :replaceFields="{
        children: 'children',
        title: 's_name',
        key: 'uid',
        value: 'uid',
      }"
    >
    </a-tree-select>
    <a-button @click="showFinder">模糊查询...</a-button>
  </div>
</template>


<script>
import { rawGet } from "@/services/crud";
import Finder from "@/components/objTree/Finder"
export default {
  components:{
    Finder,
  },
  data() {
    return {
      value: null,
      //finderShow: false,
      searchCondition: "",
      objs: [],
    };
  },
  computed: {
    treeData() {
      return this.$store.state.thingView.stationTree;
    },
  },
  methods: {
    showFinder(){
      this.$refs.finderDlg.Show(()=>{
        //alert("hihiiiiiiiiiiii")
      },this)
    },
    refresh() {
      this.$store.dispatch("thingView/refreshAllThings",{});
    },
    onSel(value, node, extra) {
      console.log("&&&&&&&&&", value, node, extra);
      let obj = this.$store.state.thingView.thingCache[value];
      if (obj) {
        this.$emit("treesel", obj);
      }
    },
    
  },
};
</script>
<style scoped>
</style>
